package com.wanshi.test;

import java.util.Arrays;

public class EE {

//    int[] n = new int[]{6, 2, 5, 8, 3, 6, 9, 4};
//    int[] result = daTiUtils.writeContent(uuid, content, method, new Object[]{n});
//    flag = flag && Arrays.equals(result, new int[]{9, 4, 5, 8, 3, 6, 6, 2});

    public static void main(String[] args) {


        System.out.println(show());
        int[] n = new int[]{6, 2, 5, 8, 3, 6, 9, 4};

        aaa(n);

    }

    /*补充方法, public int[] aaa(int[] arr){}
要求对参数数组arr中最大的与第一个元素交换;最小的与最后一个元素交换;
返回变化以后的数组。
比如 arr = {7,2,5,8,3,6,9,4}
返回 {9,4,5,8,3,6,7,2}
*/
    public static int[] aaa(int[] arr){
        int temp= 0;
        int max = arr[0];
        int min = arr[arr.length-1];

        for (int i = 1; i < arr.length; i++) {
            if (arr[i] > max) {
                temp = arr[i];
                arr[i] = max;
                arr[0] = temp;
                max = temp;
            }

        }
        for (int i = arr.length-1; i >= 0; i--) {
            if (arr[i] < min) {
                temp = arr[i];
                arr[i] = min;
                arr[arr.length-1] = temp;
                min = temp;
            }

        }
        String s = Arrays.toString(arr);
        System.out.println(s);
        return arr;
    }

    public static String show(){

        try{

            int x = 2;

            if(x == 2){
                System.out.println("11111111111");
                //return "1111111111";
            }
        }catch (Exception e){
            e.printStackTrace();
        }finally{

            System.out.println("2222222222");
            return "2222222222222";
        }
    }
}
